<?php
require_once('merchant_fns.php');
check_merchant();
echo "<table border=\"1\">
        <tr>
            <th>菜品ID</th>
            <th>菜品名称</th>
            <th>菜品简介</th>
            <th>菜品价格</th>
            <th>已售数量</th>
            <th>是否推荐</th>
            <th>菜品状态</th>
            <th>操作</th>
        </tr>";
$result = get_dishes();
while ($row = $result->fetch_array()) {
    echo "<tr>";
    echo "<td>{$row['did']}</td>";
    echo "<td>{$row['name']}</td>";
    echo "<td>{$row['info']}</td>";
    echo "<td>{$row['price']}</td>";
    echo "<td>{$row['qsold']}</td>";
    echo "<td>{$row['reced']}</td>";
    echo "<td>{$row['state']}</td>";
    echo "<td><a href=\"merchant_management_dishes.php?did={$row['did']}\">管理</a></td>";
    echo "</tr>";
}
?>

<form method="post" action="merchant_search_dishes.php" enctype="multipart/form-data" id="file_upload">
    搜索菜品&nbsp;&nbsp;<input type="text" name="search_dishes" maxlength="50" />&nbsp;
    <input type="submit" value="搜索"/>
</form>
&nbsp;
<a href=merchant_center.php>返回上页</a>